/**
 * Copyright (C) 2018 - 2020 https://github.com/LeeYan9
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.bifrost.entity;

import lombok.Data;

import javax.persistence.*;
import java.util.Date;

/**
 * @author Lee
 * Create Class on 2018/9/5
 * @com.bifrost.entity
 * @wechat-mall
 */
@Data
@Entity
@Table(name = "DAILY_SIGN_IN_HISTORY" ,
        indexes = {
                @Index(name = "SIGN_IN_LASTDATE_INDEX" ,columnList = "SIGN_IN_LASTDATE"),
                @Index(name = "SIGN_IN_DATE_INDEX" , columnList = "SIGN_IN_DATE")}
)
public class DailySignInHistory {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "SIGN_IN_ID", unique = true, nullable = false)
    private Long dailySignInId;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CUSTOMER_ID" , nullable = false, foreignKey = @ForeignKey(name = "none" , value = ConstraintMode.NO_CONSTRAINT))
    private Customer customer;

    @Column(name = "SIGN_IN_LASTDATE" , columnDefinition = "datetime DEFAULT NULL COMMENT'最后签到日期'")
    private Date signInLastDate;

    @Column(name = "PERSISTENCE_SIGN_IN_DAYS" , columnDefinition = "int(11) DEFAULT NULL COMMENT'持续签到天数'")
    private Integer persistenceSignInDays;

    @Column(name = "REMARK" , columnDefinition = "varchar(255) DEFAULT NULL COMMENT'用户签到备注'")
    private String remark;

    @Column(name = "SIGN_IN_DATE" , columnDefinition = "datetime DEFAULT NULL COMMENT'用户签到时间'")
    private Date signInDate;

    @Column(name = "BONUSPOINTS_HISTORY_ID" , columnDefinition = "bigint(20) DEFAULT NULL COMMENT'积分添加历史记录'")
    private Long bonusPointsHistoryId;

}
